const  fs=require("fs");
const path=require("path")

// let  pathfile= __dirname+"\\01作业\\data\\persons.json"

// let  pathfile= __dirname+"/01作业/data/persons.json"

// let pathfile=path.join( __dirname, "./01作业/data/persons.json" )


let pathfile=path.join( __dirname, "../person.json" )

let  persons=JSON.parse( fs.readFileSync( pathfile ,"utf-8"  ) )

console.log(persons);


// path.join( pathstr1,pathstr2,pathstr3,,,,,  )
// path.join会把这些字符串拼接起来，并且 可以识别 ./  ../  /

console.log(  path.join( "a/b/c/d" ,"e/f/g/h"  ,"/i/j/k")  );
//  a\b\c\d\e\f\g\h\i\j\k

console.log(  path.join( "a/b/c/d/e/f" ,"../../g/h/i/j"  )  );
//  a\b\c\d\g\h\i\j